class Mth():
    def add(self, a, b):
        print(a + b)
    
    def substraction(self, a, b):
        print(a - b)

    def multip(self, a, b):
        print(a * b)
    
    def division(self, a, b):
        print(a / b)

mth = Mth()  #调用Mth类
mth.add(1,2)
mth.multip(3,5)


class Mth2():
    def __init__(self, a, b):
        self.add = a+b
        self.substraction = a-b
        self.multip = a*b
        self.division = a/b

a = 9 
b = 3
mth2 =Mth2(a,b)
print(mth2.add)
print(mth2.division)

class Car1():
    wheels = 4
    lights = 2
    def __init__(self,a):
        self.distance = print(f'可以驾驶 {a} 年')

class Car2():
    def __init__(self,a):
        self.color = print(f'车身的颜色是 {a} 色')

car = Car1(30)
car.distance

class Car3(Car1,Car2):
    power = 'electric'
    def __init__(self):
        super(Car1,self).__init__(a) #此处注意传入a的值


el_car = Car3()
el_car.color
print(Car3.__mro__)
        